
<!--initialize javascript for ajax-->
<script type="text/javascript" src="<?php echo $this->baseUrl(); ?>
/js/admin-ajax.js"></script>

<?php
$this->title = "Daftar Pembeli";
$this->headTitle($this->title);
?>




<div id="view-content">
<form>
Cari :	<input type="text" size="10" value="" id="inputString" onkeyup="lookup(this.value,'buyer');"  />
</form>
<div class="tabledata" id="tabledata">
<table>
    <tr class="top">

            <td colspan="3" style="text-align:left">

            </td>
            <td colspan="5" style="text-align:right;">
                <img style="margin-bottom:-3px;margin-top:4px;" src="<?php echo $this->baseUrl(); ?>/images/icons/pencil.png" /> = edit Pembeli &nbsp;&nbsp;&nbsp;
                <img style="margin-bottom:-3px;margin-top:4px;" src="<?php echo $this->baseUrl(); ?>/images/icons/cross.png" /> = hapus Pembeli
            </td>
 </tr>
<tr class="head">
    <td>
    <a class="sort" href="<?=$this->url(array('controller'=>'buyer',
            'action'=>'list', 'order'=>'buyer_id','method'=>$this->method))?>">
     ID
    </a></td>
    <td>
        <a class="sort" href="<?=$this->url(array('controller'=>'buyer',
            'action'=>'list', 'order'=>'username','method'=>$this->method))?>">
               Username
        </a>
    </td>
    <td>
     <a class="sort" href="<?=$this->url(array('controller'=>'buyer',
            'action'=>'list', 'order'=>'name','method'=>$this->method))?>">
        Nama
    </a>
    </td>
    <td>
    <a class="sort" href="<?=$this->url(array('controller'=>'buyer',
            'action'=>'list', 'order'=>'email','method'=>$this->method))?>">
        Email
    </a>
    </td>
    <td>
    <a class="sort"  href="<?=$this->url(array('controller'=>'buyer',
            'action'=>'list', 'order'=>'gender','method'=>$this->method))?>">
            Jenis Kelamin
    </a>
    </td>
    <td>
    <a class="sort" href="<?=$this->url(array('controller'=>'buyer',
            'action'=>'list', 'order'=>'date_birth','method'=>$this->method))?>">
        Tanggal Lahir
    </a>
    </td>
    <td>
        Umur
    </a>
    </td>
    <td>
    <a class="sort" href="<?=$this->url(array('controller'=>'buyer',
            'action'=>'list', 'order'=>'city','method'=>$this->method))?>">
        Kota
    </a>
    </td>
    <td>
    <a class="sort" href="<?=$this->url(array('controller'=>'buyer',
            'action'=>'list', 'order'=>'province','method'=>$this->method))?>">
        Provinsi
    </a>
    </td>
    <td>
    <a class="sort" href="<?=$this->url(array('controller'=>'buyer',
            'action'=>'list', 'order'=>'active','method'=>$this->method))?>">
            Keaktifan
    </a>
    </td>
    <td>&nbsp;</td>
</tr>

<span id="table-content">
<?php foreach($this->buyers as $buyer) : ?>
<tr style="background-color: <?= $this->cycle(array("#ccffcc","#99ff99"))->next(); ?>;">
 

    <td>
        <a href="<?php echo $this->url(array('controller'=>'buyer',
            'action'=>'detail', 'id'=>$buyer['buyer_id']));?>">
        <?php echo $this->escape($buyer['buyer_id']);?></a>
    <td>
        <?php echo $this->escape($buyer['username']);?>
    </td>
    <td><?php echo $this->escape($buyer['name']);?></td>
    <td><?php echo $this->escape($buyer['email']);?></td>
    <td><?php echo $this->escape($buyer['gender']);?></td>
     <td><?php echo $this->escape($buyer['date_birth']);?></td>
     <td><?php echo $this->additional->birthday($this->escape($buyer['date_birth']));?> Thn</td>
     <td><?php echo $this->escape($buyer['city']);?></td>
     <td><?php echo $this->escape($buyer['province']);?></td>
      <td><?php if($this->escape($buyer['active'])==1){echo "aktif";}
      else{echo "tidak aktif";}?></td>
    <td>
        <a href="<?php echo $this->url(array('controller'=>'buyer',
            'action'=>'edit', 'id'=>$buyer['buyer_id']));?>">
            <img src="<?php echo $this->baseUrl(); ?>/images/icons/pencil.png" alt="edit"/></a>
        <a href="javascript: deleting('<?php echo $this->url(array('controller'=>'buyer',
            'action'=>'remove', 'id'=>$buyer['buyer_id']));?>')">
            <img src="<?php echo $this->baseUrl(); ?>/images/icons/cross.png" alt="delete"></a>
    </td>
</tr>

<?php endforeach; ?>
</span>
<tr>
    <td colspan="7">
           <?= $this->back?>
           <?= $this->current?>/<?=$this->totalPages?>
          <?=$this->next?>
    </td>
</tr>
</table>
    </div>
</div>